package org.gurms.dao.po.system;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

@Entity
@Table(
		name = "sys_userinfo",
		uniqueConstraints={@UniqueConstraint(columnNames={"email"})}
)
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class SysUserInfo implements Serializable {
	private String userid;
	private String username;
	private String sex;
	private String birthday;
	private String education;
	private String mobile;
	private String address;
	private String hometel;
	private String email;
	private String company;
	private String province;
	private String city;
	private String postcode;

	@Id
	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(columnDefinition="default '1'")
	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public String getEducation() {
		return education;
	}

	public void setEducation(String education) {
		this.education = education;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getHometel() {
		return hometel;
	}

	public void setHometel(String hometel) {
		this.hometel = hometel;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getPostcode() {
		return postcode;
	}

	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}
	
	public boolean equals(Object o){
		if(o == null || !(o instanceof SysUserInfo)){
			return false;
		}else{
			SysUserInfo info = (SysUserInfo)o;
			if(info.getUserid() == null){
				return false;
			}else{
				return info.getUserid().equals(userid);
			}
		}
	}
	
	public int hashCode(){
		if(userid == null)
			return super.hashCode();
		return userid.hashCode();
	}
}
